#!/usr/bin/env python
# -*- coding: utf-8 -*-

from active import active

bash = active.Active("bash", timeout=20)

print(bash.expect(r".+:.+\$ "))

bash.write("mkdir -p /tmp/active_test\n")
print(bash.expect(r".+:.+\$ "))

bash.write("cd /tmp/active_test\n")
print(bash.expect(r".+:.+\$ "))

bash.write("touch hello\n")
print(bash.expect(r".+:.+\$ "))

bash.write("touch active\n")
print(bash.expect(r".+:.+\$ "))

bash.write("mkdir next\n")
print(bash.expect(r".+:.+\$ "))

bash.write("touch ./next/0_0\n")
print(bash.expect(r".+:.+\$ "))

bash.write("touch ./next/=_=\n")
print(bash.expect(r".+:.+\$ "))

bash.write("touch ./next/+_+\n")
print(bash.expect(r".+:.+\$ "))

bash.write("tree\n")
print(bash.expect(r".+:.+\$ "))

bash.write("cd -\n")
print(bash.expect(r".+:.+\$ "))

bash.write("rm -rf /tmp/active_test\n")
print(bash.expect(r".+:.+\$ "))
